package com.sunday.common.mq.rabbit.study.base;

import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class ConnectionUtil {

    public static ConnectionFactory factory() throws IOException, TimeoutException {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setUsername("admin");// 用户名
        factory.setPassword("admin");// 密码
        factory.setVirtualHost("my_vhost");// 虚拟主机
        factory.setHost("127.0.0.1");// 主机名
        return factory;
    }

}
